<template>
  <div>
    列表页

    <ul class="list">
      <li v-for="item in list" :key="item.item_id">
        <router-link
          :to="'/item/' + item.item_id + '/' + item.min_price"
          class="item"
        >
          <div class="item_img"><img :src="item.over_image_url" /></div>
          <div class="item_text">{{ item.item_name }}</div>
        </router-link>
      </li>
    </ul>
  </div>
</template>
<script>
//引入axios
import axios from "axios";
export default {
  name: "List",
  data() {
    return {
      list: [],
    };
  },
  created() {
    //获取列表数据
    axios.get("/json/list.json").then((res) => {
      console.log(res);
      this.list = res.data.data.item_list;
    });
  },
  methods: {},
  components: {},
};
</script>
<style scoped>
* {
  padding: 0;
  margin: 0;
}
ul,
li {
  list-style: none;
}
a {
  text-decoration: none;
  color: #000;
}
.item {
  display: flex;
  height: 100px;
  line-height: 100px;
  border-bottom: 1px solid #ccc;
}
.item_img {
  width: 30%;
}
.item_text {
  width: 70%;
}
.item img {
  width: 80px;
}
</style>